﻿<%@ WebHandler Language="C#" Class="regHandler" %>

using System;
using System.Web;

using BLL;

public class regHandler : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";

        string memberName = context.Request["memberName"];
        string res = "-1"; //成功

        if (string.IsNullOrEmpty(memberName))
        {
            res = "0"; //错误
            context.Response.Write(res.ToString());
            context.Response.End();
        }

        MembersBll bl = new MembersBll();
        if (bl.CheckMember(memberName))
        {
            res = "3"; //用户已存在
        }

        context.Response.Write(res.ToString());
        context.Response.End();
    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}